from roles import *
from hitprobability import *
magician_role=magician
soldier_role=soldier
probability_judge=probability_judge(magician_role.probability_judge)
while soldier_role.distance>0 or soldier_role.hp>0:
    action = int(input("请输入你的行动（1为前进，2为回复，3为叠甲）："))
    if probability_judge==False:
        print("法师释放了攻击对" + str(soldier_role.name) + "造成了点" + str(0) + "伤害")
        magician_attack = magician_role.magician_attack(soldier_role)
        soldier_attack = soldier_role.soldier_attack(magician_role, action)
        print(info(soldier_role))
    else:
        magician_attack = magician_role.magician_attack(soldier_role)
        print("法师释放了攻击对" + str(soldier_role.name) + "造成了点" + str(magician.attack - soldier_role.defense * 10) + "伤害")
        #------为什么当probability_judge==Flase的时候else里面的语句还会运行------#
        soldier_attack = soldier_role.soldier_attack(magician_role, action)
        print(info(soldier_role))
if soldier_role.distance<=0 and soldier_role.hp>=0:#-----结束判定（这里当战士根据法师的距离为0时并没有输出战士胜利）----#
         print("战士胜利" "%s法师，菜就多练输不起就别玩" %magician_role.name)
elif soldier_role.hp<=0:
         print("法师胜利""%s战士，菜就多练输不起就别玩" %soldier_role.name)
elif soldier_role.distance<=0 and soldier_role.hp<=0:
         print("平局")




